import Vue from 'vue';
import Vuex from 'vuex';
import http from '@/http/index'

Vue.use(Vuex)

let store = new Vuex.Store({

    modules: {
        http,
    },

    state:{
        userInfo: {},
        localUserInfo: {},
    },

    mutations:{

        setState(state, {targetName, data}){
          if(targetName){
              state[targetName] = data;  
          }
        },
        
        setUserInfo(state, data){
            state.userInfo = data;
        },

        setLocalUserInfo(state, data){
            state.localUserInfo = data;
        },

    },

    actions: {
        
    }
    
})

export default store